To durably save, in a database, a modification made by a transaction to data in a database system, and avoid a rollback operation, a transaction log generated in a transaction processing process is usually written to a reliable disk medium. When a data loss occurs in the database system, the transaction log in a disk provides a basis for a data restoration operation in the database system, so as to achieve durability of the database system.
A transaction log is usually saved by using a synchronous submission solution, that is, when a transaction is submitted, a last recording location corresponding to a generated transaction log is selected, and after all transaction logs before the location are written into a disk, submission of the transaction is ended.
Because in the foregoing solution, disk write JO operations are generated in a database system, in a case of a large concurrent amount of transactions, a concurrent conflict of the database system is caused. The prior art provides an asynchronous submission solution for a transaction log, where a transaction submission operation may be prior to an operation of writing a transaction log into a disk, so as to reduce a concurrent conflict event of the database system. The prior art has at least the following problems: In a scenario in which an existing technical solution is applied to a cluster database, after a node in the cluster database performs transaction submission, if a data crash event occurs in the node when a transaction log has not been completely written into a disk, a database system cannot perform a data restoration operation according to the transaction log, which causes a situation of a permanent data loss. Therefore, it can be known that the asynchronous submission solution for a transaction log affects data durability of a database system, causes a data loss risk to the database system, reduces safety of the database system, and makes the database system unreliable.